#include "tv.h"
#include "uart.h"
void init_taster()
{
	PORTA |= (1 << PA6);		// activate pull-up resistor on pa7
}

int get_taster()
{
	int val = read_adc(6);
	if(val >= 400 && val <= 450) {
		return 4;
	} else if(val >= 350 && val <= 395) {
		return 3;
	} else if(val >= 300 && val <= 345) {
		return 2;
	} else if(val >= 250 && val <= 290) {
		return 1;
	} else if(val >= 150 && val <= 200) {
		return 0;
	} else {
		return -1;
	}
}

